package com.d0327.Z27;

import java.util.Comparator;

public class TestComeparetor implements Comparator<Student> {
    @Override
    public int compare(Student o1, Student o2) {
        if (o1.getCourse() > o2.getCourse()) {
            return -1;
        } else if (o1.getCourse() < o2.getCourse()) {
            return 1;
        } else if(o1.getCourse()==o2.getCourse()){
            if(o1.getId()>o2.getCourse()){
                return 1;
            }
        }
        return 0;
    }
}
